import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_svg/flutter_svg.dart';

class Empty extends StatelessWidget {
  final double imgWidth;
  final double imgHeight;
  final String imgSrc;
  final String label;
  final EdgeInsets labelPadding;
  final TextStyle labelStyle;
  final MainAxisAlignment mainAxisAlignment;

  const Empty({
    super.key,
    this.imgSrc = "assets/images/empty/default_empty.svg",
    this.label = '',
    this.mainAxisAlignment = MainAxisAlignment.center,
    this.labelPadding = const EdgeInsets.only(top: 5),
    this.labelStyle = const TextStyle(color: Colors.grey, fontSize: 14),
    this.imgWidth = 90,
    this.imgHeight = 90,
  });

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        mainAxisAlignment: mainAxisAlignment,
        children: [
          SvgPicture.asset(imgSrc, width: imgWidth, height: imgHeight),
          Padding(
            padding: labelPadding,
            child: Text(
              label.isEmpty
                  ? AppLocalizations.of(context)!.dataEmptyLabel
                  : label,
              style: labelStyle,
            ),
          ),
        ],
      ),
    );
  }
}
